package org.drushpal.view.panels
{
	import flash.events.MouseEvent;
	
	import mx.binding.utils.BindingUtils;
	
	import org.drushpal.service.DrushService;
	import org.robotlegs.mvcs.Mediator;

	public class TerminalPanelMediator extends Mediator
	{
		[Inject]public var terminalTab:TerminalPanel;
		[Inject]public var drushService:DrushService;
		override public function onRegister():void{
			BindingUtils.bindProperty(terminalTab.terminalArea,"text",drushService,"terminal");
			eventMap.mapListener(terminalTab.btnClearTerminal,MouseEvent.CLICK,onClearTerminal);
		}
		private function onClearTerminal(event:MouseEvent):void{
			drushService.terminal = "";
		}
		
	}
}